package distributedRE.model;

import java.util.ArrayList;

import utils.query.LuceneQueryParser;


public class Query {

	private long Id;
	private String text;
	private long ieId;
	private ArrayList<String> must_words;
	private ArrayList<String> must_not_words;
	private int size;
	private long rId;

	public Query(long qId, String text, long ieId, long rId) {
		
		this.Id = qId;
		this.text = text;
		this.ieId = ieId;
		this.rId = rId;
		must_words = new ArrayList<String>();
		must_not_words = new ArrayList<String>();
		this.text = text;
		LuceneQueryParser.parseQuery(text,must_words,must_not_words);
		size = must_not_words.size() + must_words.size();
	}

	public long getInformationExtractorId(){
		return ieId;
	}
	
	public long getId() {
		return Id;
	}

	public ArrayList<String> getMustWords() {
		return must_words;
	}

	public ArrayList<String> getMustNotWords() {
		return must_not_words;
	}

	public boolean equals(Object o){
		return (Id == ((Query)o).Id);
	}

	public String getText() {
		
		return text;

	}

	public long getSize() {
		return size;
	}

	public long getrId() {
		return rId;
	}
	
}
